part of shop; //封装类
//动态变化明天再做吧

class Userpicturedemo extends StatelessWidget {
  final double anglecircular;
  final double height;
  final double width;
  const Userpicturedemo(
      {Key? key, this.anglecircular = 10, this.height = 160, this.width = 160})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
        width: width,
        height: height,
        decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(anglecircular),
            image: const DecorationImage(
                image: NetworkImage(AppConfig.defaultAvatar), fit: BoxFit.cover)));
  }
}

class Usernameinfodemo extends StatelessWidget {
  final String userName;
  final double fontSize;
  final FontWeight fontWeight;

  const Usernameinfodemo(
      {Key? key,
      this.userName = "",
      this.fontSize = 23,
      this.fontWeight = FontWeight.w800})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Text(userName,
        style: TextStyle(
          fontSize: fontSize,
          fontWeight: FontWeight.w500,
          color: Colors.white,
        ));
  }
}

class userlocationsdemo extends StatelessWidget {
  final double fontSize;
  final Color color;
  final String dormitory;
  const userlocationsdemo({
    this.dormitory = '',
    Key? key,
    this.fontSize = 15,
    required this.color,
  }) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Text(dormitory, style: TextStyle(fontSize: fontSize, color: color));
  }
}

class userWhitedemo extends StatelessWidget {
  final double height;
  final double width;
  final String text;
  final Color color;

  const userWhitedemo(
      {Key? key,
      this.height = 24,
      this.width = 108,
      required this.text,
      required this.color})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Text(text,
          textAlign: TextAlign.center,
          style: const TextStyle(wordSpacing: 0.1, color: Colors.white)),
      height: height,
      width: width,
      decoration: BoxDecoration(
          color: const Color.fromRGBO(111, 207, 151, 1),
          border: Border.all(
            color: const Color.fromRGBO(111, 207, 151, 1),
            width: 1.0,
          ),
          borderRadius: const BorderRadius.all(Radius.circular(4.0))),
    );
  }
}

class usernumberdemo extends StatelessWidget {
  final String number;
  const usernumberdemo({Key? key, this.number = ''}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
        child: Text(
      number,
      style: const TextStyle(color: Colors.white, fontStyle: FontStyle.italic),
    ));
  }
}

class usersellnumber extends StatelessWidget {
  final int sellnumber;
  final double fontsize = 10;
  final Color color = const Color.fromRGBO(38, 35, 35, 0.86);

  usersellnumber({Key? key, this.sellnumber = 1}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Text(
      "卖出过$sellnumber件商品",
      style: TextStyle(fontSize: fontsize, color: color),
    );
  }
}
